<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>信息显示界面</title>
    <script src="../../res/layui/layui.js"></script>
    <link rel="stylesheet" href="../../res/layui/css/layui.css" type="text/css">
    <script src="../../res/js/Tools.js" charset="utf-8"></script>
    <script src="../../res/js/jquery-3.1.1.min.js" charset="utf-8"></script>
    <style>
        #site{
            font: bold 10px "微软雅黑";
        }
        .file {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }
        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }
        .file:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }
    </style>
</head>
<body>
<div class="layui-form-item layui-form-text" id="newtext">
    <label class="layui-form-label">内容：</label>
    <div class="layui-input-block">
        <textarea placeholder="没有任何内容哦" class="layui-textarea" id="attachContent" name="attachContent"></textarea>
    </div>
</div>
<div class="layui-form-item layui-form-text" class="imgContent" id="file1div">
    <label class="layui-form-label">附件1：</label>
    <div class="layui-input-block">
        <input type="text" disabled="disabled" class="layui-input" id="site1" name="site1">
        <a href="#" target="_blank" class="file" id="file1">下载文件</a>
    </div>
    <div class="layui-form-item layui-form-text" class="imgContent" id="file2div">
        <label class="layui-form-label">附件2：</label>
        <div class="layui-input-block">
            <input type="text" disabled="disabled" class="layui-input" id="site2" name="site1">
            <a href="#" target="_blank" class="file" id="file2">下载文件</a>
        </div>
        <div class="layui-form-item layui-form-text" class="imgContent" id="file3div">
            <label class="layui-form-label">附件3：</label>
            <div class="layui-input-block">
                <input type="text" disabled="disabled" class="layui-input" id="site3" name="site1">
                <a href="#" target="_blank" class="file" id="file3">下载文件</a>
            </div>
            <script>
                var attachType=getQueryString("attachType");
                var attachId=getQueryString("attachId");
                $(function(){
                    $(".imgContent").hide();
                    if(attachType!=10){
                        $(".imgContent").show();
                    }
                    formvaluation();
                })
                function formvaluation(){
                    var url="../../AtsAttachmentAction/selectByPrimaryKey?attachId="+attachId;
                    $.post(url,null,function(obj){
                        $("#attachContent").val(obj.attachContent);
                        if(obj.file1!=null){
                            $("#site1").val(obj.file1);
                            $("#file1").attr("href","../.."+obj.file1);
                        }else{
                            $("#file1div").hide();
                        }
                        if(obj.file2!=null){
                            $("#site2").val(obj.file2);
                            $("#file2").attr("href","../.."+obj.file2);
                        }else{
                            $("#file2div").hide();
                        }
                        if(obj.file3!=null){
                            $("#site3").val(obj.file3);
                            $("#file3").attr("href","../.."+obj.file3);
                        }else{
                            $("#file3div").hide();
                        }
                    })
                }
            </script>
</body>
</html>